<?php

namespace App\Http\Controllers\home;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Banner;
use App\Cases;
class CaseController extends Controller
{
    protected $banner;

    public function __construct()
    {
        //获取banner
        $banner = Banner::where('entitle','=','product')->first();
        $this->banner  = $banner->banneritem[0];

    }
    public function index(){
        $banners=$this->banner;
        $case=Cases::OrderBy('created_at','desc')->paginate(6);
        return view('home.case.index',compact('banners','case'));
    }
}
